package com.itheima.service.impl;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.pojo.Dept;
import com.itheima.pojo.Grades;
import com.itheima.service.GradesService;
import com.itheima.mapper.GradesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author VRMMO
* @description 针对表【grades】的数据库操作Service实现
* @createDate 2025-03-26 20:16:47
*/
@Service
public class GradesServiceImpl extends ServiceImpl<GradesMapper, Grades>
    implements GradesService{

    @Autowired
    private GradesMapper gradesMapper;

    @Override
    public List<Grades> list() {
        return gradesMapper.selectList(null);
    }

    // 查询单个年级
    @Override
    public Grades getById(Integer gradeid) {
        return gradesMapper.selectById(gradeid);
    }

    // 根据gradeid删除
    @Override
    public void delete(Integer gradeid) {
        gradesMapper.deleteByGradeid(gradeid);
    }

    // 添加年级
    @Override
    public void add(Grades grades) {
        gradesMapper.inserts(grades);
    }

    @Override
    public void update(Grades grades) {
        gradesMapper.update(grades);
    }

}




